package atest.model;

import java.util.Arrays;
import java.util.List;

/**
 * 
 */
public enum SexType {
	MALE("male", "男"), FEMALE("female", "女");

	private String	code;
	private String		message;

	// 构造方法
	private SexType(String code, String message) {
		this.code = code;
		this.message = message;
	}

	// 普通方法
	public static String getName(String code) {
		for (SexType c : SexType.values()) {
			if (c.getCode().equals(code)) {
				return c.message;
			}
		}
		return null;
	}

	public static SexType getTraceType(String code) {
		for (SexType c : SexType.values()) {
			if (c.getCode().equals(code)) {
				return c;
			}
		}
		return null;
	}

	public static List<SexType> getEnumItemList() {
		return Arrays.asList(SexType.values());
	}

	// get set 方法
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
}